// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗  
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝  
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// -----------------------------------------------
//  
// This file is automatically generated 
// Please do not edit these files manually
// Run the following in the root of the repos:
//
// 		*NIX 		:	./build.sh codegen
// 		Windows 	:	build.bat codegen
//
// -----------------------------------------------
// ReSharper disable RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using Elastic.Transport;
using Elasticsearch.Net;
using Nest.Utf8Json;
using Elasticsearch.Net.Specification.EqlApi;

// ReSharper disable RedundantBaseConstructorCall
// ReSharper disable UnusedTypeParameter
// ReSharper disable PartialMethodWithSinglePart
// ReSharper disable RedundantNameQualifier
namespace Nest
{
	[InterfaceDataContract]
	public partial interface IEqlDeleteRequest : IRequest<EqlDeleteRequestParameters>
	{
		[IgnoreDataMember]
		Id Id
		{
			get;
		}
	}

	///<summary>Request for Delete <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html</para></summary>
	public partial class EqlDeleteRequest : PlainRequestBase<EqlDeleteRequestParameters>, IEqlDeleteRequest
	{
		protected IEqlDeleteRequest Self => this;
		internal override ApiUrls ApiUrls => ApiUrlsLookups.EqlDelete;
		protected override HttpMethod HttpMethod => HttpMethod.DELETE;
		protected override bool SupportsBody => false;
		///<summary>/_eql/search/{id}</summary>
		///<param name = "id">this parameter is required</param>
		public EqlDeleteRequest(Id id): base(r => r.Required("id", id))
		{
		}

		///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
		[SerializationConstructor]
		protected EqlDeleteRequest(): base()
		{
		}

		// values part of the url path
		[IgnoreDataMember]
		Id IEqlDeleteRequest.Id => Self.RouteValues.Get<Id>("id");
	// Request parameters
	}

	[InterfaceDataContract]
	public partial interface IEqlGetRequest : IRequest<EqlGetRequestParameters>
	{
		[IgnoreDataMember]
		Id Id
		{
			get;
		}
	}

	///<summary>Request for Get <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html</para></summary>
	public partial class EqlGetRequest : PlainRequestBase<EqlGetRequestParameters>, IEqlGetRequest
	{
		protected IEqlGetRequest Self => this;
		internal override ApiUrls ApiUrls => ApiUrlsLookups.EqlGet;
		protected override HttpMethod HttpMethod => HttpMethod.GET;
		protected override bool SupportsBody => false;
		///<summary>/_eql/search/{id}</summary>
		///<param name = "id">this parameter is required</param>
		public EqlGetRequest(Id id): base(r => r.Required("id", id))
		{
		}

		///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
		[SerializationConstructor]
		protected EqlGetRequest(): base()
		{
		}

		// values part of the url path
		[IgnoreDataMember]
		Id IEqlGetRequest.Id => Self.RouteValues.Get<Id>("id");
		// Request parameters
		///<summary>Update the time interval in which the results (partial or final) for this search will be available</summary>
		public Time KeepAlive
		{
			get => Q<Time>("keep_alive");
			set => Q("keep_alive", value);
		}

		///<summary>Specify the time that the request should block waiting for the final response</summary>
		public Time WaitForCompletionTimeout
		{
			get => Q<Time>("wait_for_completion_timeout");
			set => Q("wait_for_completion_timeout", value);
		}
	}

	[InterfaceDataContract]
	public partial interface IEqlSearchStatusRequest : IRequest<EqlSearchStatusRequestParameters>
	{
		[IgnoreDataMember]
		Id Id
		{
			get;
		}
	}

	///<summary>Request for SearchStatus <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html</para></summary>
	public partial class EqlSearchStatusRequest : PlainRequestBase<EqlSearchStatusRequestParameters>, IEqlSearchStatusRequest
	{
		protected IEqlSearchStatusRequest Self => this;
		internal override ApiUrls ApiUrls => ApiUrlsLookups.EqlSearchStatus;
		protected override HttpMethod HttpMethod => HttpMethod.GET;
		protected override bool SupportsBody => false;
		///<summary>/_eql/search/status/{id}</summary>
		///<param name = "id">this parameter is required</param>
		public EqlSearchStatusRequest(Id id): base(r => r.Required("id", id))
		{
		}

		///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
		[SerializationConstructor]
		protected EqlSearchStatusRequest(): base()
		{
		}

		// values part of the url path
		[IgnoreDataMember]
		Id IEqlSearchStatusRequest.Id => Self.RouteValues.Get<Id>("id");
	// Request parameters
	}

	[InterfaceDataContract]
	public partial interface IEqlSearchRequest : IRequest<EqlSearchRequestParameters>
	{
		[IgnoreDataMember]
		Indices Index
		{
			get;
		}
	}

	public partial interface IEqlSearchRequest<TInferDocument> : IEqlSearchRequest
	{
	}

	///<summary>Request for Search <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html</para></summary>
	public partial class EqlSearchRequest : PlainRequestBase<EqlSearchRequestParameters>, IEqlSearchRequest
	{
		protected IEqlSearchRequest Self => this;
		internal override ApiUrls ApiUrls => ApiUrlsLookups.EqlSearch;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => true;
		///<summary>/{index}/_eql/search</summary>
		///<param name = "index">this parameter is required</param>
		public EqlSearchRequest(Indices index): base(r => r.Required("index", index))
		{
		}

		///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
		[SerializationConstructor]
		protected EqlSearchRequest(): base()
		{
		}

		// values part of the url path
		[IgnoreDataMember]
		Indices IEqlSearchRequest.Index => Self.RouteValues.Get<Indices>("index");
		// Request parameters
		///<summary>Update the time interval in which the results (partial or final) for this search will be available</summary>
		public Time KeepAlive
		{
			get => Q<Time>("keep_alive");
			set => Q("keep_alive", value);
		}

		///<summary>
		/// Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default:
		/// false)
		///</summary>
		public bool? KeepOnCompletion
		{
			get => Q<bool? >("keep_on_completion");
			set => Q("keep_on_completion", value);
		}

		///<summary>Specify the time that the request should block waiting for the final response</summary>
		public Time WaitForCompletionTimeout
		{
			get => Q<Time>("wait_for_completion_timeout");
			set => Q("wait_for_completion_timeout", value);
		}
	}

	public partial class EqlSearchRequest<TInferDocument> : EqlSearchRequest, IEqlSearchRequest<TInferDocument>
	{
		protected IEqlSearchRequest<TInferDocument> TypedSelf => this;
		///<summary>/{index}/_eql/search</summary>
		///<param name = "index">this parameter is required</param>
		public EqlSearchRequest(Indices index): base(index)
		{
		}

		///<summary>/{index}/_eql/search</summary>
		public EqlSearchRequest(): base(typeof(TInferDocument))
		{
		}
	}
}